// 跨域代理
//  "proxy": "http://localhost:4000"

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app){
  app.use(
    createProxyMiddleware('/api',{
      target:'http://localhost:4000',
      changeOrigin: true,
      pathRewrite:{
        '^/api': ''
      }
    })
  ),
  app.use(
    createProxyMiddleware('/api', {
      target:'http://10.0.50.153:4000',
      changeOrigin: true,
      pathRewrite:{
        '^/api': ''
      }
    })
  )
}
